const path = require('path')

module.exports = {
    mode: 'development',
    entry: './src/index.js',
    experiments: {
        outputModule: true
    },
    output: {
        //     clean: true,
        //     library: {
        //         type: 'umd',
        //         name: 'LaunchVueImSocket',
        //         export: 'default'
        //     },
        // libraryTarget: 'umd',
        libraryTarget: 'module',
        path: path.resolve(__dirname, 'dist'),
        // libraryExport: 'default',
        // globalObject: 'typeof self !== "undefined" ? self : this'
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: [
                    {
                        loader: 'babel-loader',
                        options: {
                            presets: ['@babel/preset-env'],
                            plugins: [
                                '@babel/plugin-proposal-class-properties',
                                '@babel/plugin-transform-classes',
                            ],
                        },
                    },
                ]
            },
        ],
    },
}